package org.example.config2;

import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.web.authentication.WebAuthenticationDetails;

import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
/**
 * @Author GongXl
 * @Description 返回我们刚才定义的MyWebAuthenticationDetails资源
 * @Date 2021/3/23 10:51
 * @Param 
 * @return 
 **/
@Component
public class MyAuthenticationDetailsSource implements AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails> {

    @Override
    public WebAuthenticationDetails buildDetails(HttpServletRequest context) {
        return new MyWebAuthenticationDetails(context);
    }
}